package com.desitek.cricket.action;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import com.desitek.cricket.entity.Groups;
import com.desitek.cricket.repository.GroupRepository;

public class Main {
	public static void main(String argv[]) {

		BeanFactory bf = new XmlBeanFactory(new ClassPathResource("applicationContext.xml"));
		
		GroupRepository dao = (GroupRepository) bf.getBean("com.desitek.cricket.repository.GroupRepository");
		Groups group = new Groups();
		group.setGrpName("GUEST");
		group.setGrpDescription("guest group with limited permission");
		group.setGrpStatus(true);
		dao.save(group);

		group = dao.findById(1);
		System.out.println(group.getGrpName());
	}

}
